<template>
	<view class="container">
		<text class="title">{{proto_title}}</text>
		<text class="content">{{proto_content}}</text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				proto_content:'',
				proto_title:''
			};
		},
		
		onLoad() {
			this.get_face_doc()
		},
		methods:{
			// 获取创建脸谱协议
			get_face_doc(){
				let self=this
				this.$u.api.get_sys_protocal({
					type:1
				}).then(res=>{
					if(res.code==200){
						self.proto_content=self.deal_str(res.data.content)
						self.proto_title=res.data.title
					}
				})
			},
			deal_str(str){
				var re1=/<p>/gi
				var re2=/<\/p>/gi
				var re3=/<br\/>/gi
				var ss=str.replace(re1,'').replace(re2,'\n').replace(re3,'')
				return ss
			}
		}
	}
	
	
	
	
</script>

<style lang="scss">
	.container{
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		align-items: center;
		
		padding: 10rpx;
		.title{
			margin-top: 10rpx;
			margin-bottom: 10rpx;
		}
	}
</style>
